#ifndef ______REALTIMEDATA_H____
#define ______REALTIMEDATA_H____

class RealTimeDataInfo
{
public:
    const char *name;
    const char *id;
    const char *commit;

    RealTimeDataInfo(){}
    RealTimeDataInfo (const char*n,const char*i,const char*c){name = n;id = i;commit = c;}
    RealTimeDataInfo (std::string n,std::string i,std::string c){name = n.c_str();id = i.c_str();commit = c.c_str();}
};

#define REALTIMEDATA_ITEMS()    \
RealTimeDataItem	INV_C_S	{"INV_C_S",	    {"通信状态", "INV_C_S", "0 正常 1 掉线"}};	\
RealTimeDataItem	INV_C_ERRN	{"INV_C_ERRN",	    {"通讯错误计数", "INV_C_ERRN", ""}};	\
RealTimeDataItem	INV_BP_S	{"INV_BP_S",	    {"旁路启动", "INV_BP_S", "0 未旁路 1已旁路"}};	\
RealTimeDataItem	INV_W_S	{"INV_W_S",	    {"工作状态", "INV_W_S", "0为关机 1为自检 2为太阳能+电池供电 4、6为电网供电 5停止状态,其中电网供电中 ：(4为电网只给负载供电 6为电网给负载供电同时又给电池充电)"}};	\
RealTimeDataItem	BAT_V	{"BAT_V",	    {"电池电压", "BAT_V", ""}};	\
RealTimeDataItem	INV_O_V	{"INV_O_V",	    {"逆变电压", "INV_O_V", ""}};	\
RealTimeDataItem	INV_GRID_V	{"INV_GRID_V",	    {"电网电压", "INV_GRID_V", ""}};	\
RealTimeDataItem	BAT_I	{"BAT_I",	    {"电池电流", "BAT_I", ""}};	\
RealTimeDataItem	INV_I	{"INV_I",	    {"逆变电流", "INV_I", ""}};	\
RealTimeDataItem	GRID_I	{"GRID_I",	    {"电网电流", "GRID_I", ""}};	\
RealTimeDataItem	LOAD_I	{"LOAD_I",	    {"负载电流", "LOAD_I", ""}};	\
RealTimeDataItem	BAT_P	{"BAT_P",	    {"电池功率", "BAT_P", ""}};	\
RealTimeDataItem	INV_P	{"INV_P",	    {"逆变功率", "INV_P", ""}};	\
RealTimeDataItem	GRID_P	{"GRID_P",	    {"电网功率", "GRID_P", ""}};	\
RealTimeDataItem	LOAD_P	{"LOAD_P",	    {"负载功率", "LOAD_P", ""}};	\
RealTimeDataItem	LOAD_PER	{"LOAD_PER",	    {"负载占用率", "LOAD_PER", ""}};	\
RealTimeDataItem	AC_T	{"AC_T",	    {"交流散热器温度", "AC_T", ""}};	\
RealTimeDataItem	TR_T	{"TR_T",	    {"变压器温度", "TR_T", ""}};	\
RealTimeDataItem	DC_T	{"DC_T",	    {"直流散热器温度", "DC_T", ""}};	\
RealTimeDataItem	INV_R	{"INV_R",	    {"逆变继电器状态", "INV_R", "0 断开 1 连接"}};	\
RealTimeDataItem	GRID_R	{"GRID_R",	    {"电网继电器状态", "GRID_R", "0 断开 1 连接"}};	\
RealTimeDataItem	LOAD_R	{"LOAD_R",	    {"负载继电器状态", "LOAD_R", "0 断开 1 连接"}};	\
RealTimeDataItem	N_LINE_R	{"N_LINE_R",	    {"N线继电器状态", "N_LINE_R", "0 断开 1 连接"}};	\
RealTimeDataItem	DC_R	{"DC_R",	    {"直流继电器状态", "DC_R", "0 断开 1 连接"}};	\
RealTimeDataItem	ETH_R	{"ETH_R",	    {"接地继电器状态", "ETH_R", "0 断开 1 连接"}};	\
RealTimeDataItem	PV_C	{"PV_C",	    {"通信状态", "PV_C", "0 正常 1 掉线"}};	\
RealTimeDataItem	PV_C_ERRN	{"PV_C_ERRN",	    {"通信错误计数", "PV_C_ERRN", ""}};	\
RealTimeDataItem	PV_W_S	{"PV_W_S",	    {"工作状态", "PV_W_S", "0：初始化 1：自测试2：工作中3：停止"}};	\
RealTimeDataItem	MPPT_S 	{"MPPT_S",	    {"MPPT状态", "MPPT_S", "0：停止 1：最大功率跟踪 2: 恒流"}};	\
RealTimeDataItem	PV_CHA_S	{"PV_CHA_S",	    {"充电状态", "PV_CHA_S", "0:停止1:恒流 2: 浮充3:保留"}};	\
RealTimeDataItem	PV_V	{"PV_V",	    {"电池板电压", "PV_V", ""}};	\
/*RealTimeDataItem	BAT_V	{"BAT_V",	    {"电池电压", "BAT_V", ""}};*/	\
RealTimeDataItem	PV_I	{"PV_I",	    {"充电电流", "PV_I", ""}};	\
RealTimeDataItem	PV_P	{"PV_P",	    {"充电功率", "PV_P", ""}};	\
RealTimeDataItem	BAT_R	{"BAT_R",	    {"电池继电器状态", "BAT_R", "0 断开 1 连接"}};	\
RealTimeDataItem	PV_R	{"PV_R",	    {"太阳能板继电器状态", "PV_R", "0 断开 1 连接"}};	\
RealTimeDataItem	 EP_C_S	{"EP_C_S",	    {"通信状态", " EP_C_S", " 0 正常 1 掉线 "}};	\
RealTimeDataItem	 EP_C_ERRN	{"EP_C_ERRN",	    {"通信错误计数", " EP_C_ERRN", ""}};	\
RealTimeDataItem	 EP_KWH	{"EP_KWH",	    {"总电能", " EP_KWH", ""}};	\
RealTimeDataItem	 IN_GRID_V	{"IN_GRID_V",	    {"电网进线电压", " IN_GRID_V", ""}};	\
RealTimeDataItem	 IN_GRID_I	{"IN_GRID_I",	    {"电网进线电流", " IN_GRID_I", ""}};	\
RealTimeDataItem	 IN_GRID_P	{"IN_GRID_P",	    {"电网进线有功功率", " IN_GRID_P", ""}};	\
RealTimeDataItem	 PB_C_S	{"PB_C_S",	    {"通信状态", " PB_C_S", " 0 正常 1 掉线 "}};	\
RealTimeDataItem	 PB_C_ERRN	{"PB_C_ERRN",	    {"通信错误计数", " PB_C_ERRN", ""}};	\
RealTimeDataItem	 PB_MA_P	{"PB_MA_P",	    {"手自动位置", " PB_MA_P", " 0 自动 1 手动 "}};	\
RealTimeDataItem	 PB_SW_P	{"PB_SW_P",	    {"开关位置", " PB_SW_P", " 0 断开 1 连接"}};	\
/*sms[15]*/ \
RealTimeDataItem	 SMS_C_S	{"SMS_C_S",	    {"通信状态", " SMS_C_S", "0 正常 1 掉线"}};	\
RealTimeDataItem	 SMS_C_ERRN 	{"SMS_C_ERRN",	    {"通信错误计数", " SMS_C_ERRN", ""}};	\
RealTimeDataItem	 SMS_PB_S 	{"SMS_PB_S",	    {"旁路启动", " SMS_PB_S", "0 未旁路 1 已旁路 逆变器旁路输出启动"}};	\
RealTimeDataItem	 SMS_V 	{"SMS_V",	    {"通道电压值", " SMS_V", ""}};	\
RealTimeDataItem	 SMS_VERR 	{"SMS_VERR",	    {"电压故障位", " SMS_VERR", "0 正常 1 欠压 2 过压"}};	\
RealTimeDataItem	 SMS_VERRV 	{"SMS_VERRV",	    {"电压故障值", " SMS_VERRV", ""}};	\
RealTimeDataItem	 SMS_CHn_S[15];/*{"SMS_CH1_S",	    {"通道 1 状态", " SMS_CH1_S", "0 断开 1 连接"}};*/	\
RealTimeDataItem	 SMS_CHn_I[15];/*{"SMS_CH1_I",	    {"通道 1 电流值", " SMS_CH1_I", ""}};*/	\
RealTimeDataItem	 SMS_CHn_ERR[15];/*	{"SMS_CH1_ERR",	    {"通道 1 电流故障状态", " SMS_CH1_ERR", "0 正常 1 过载 2 过流"}};*/	\
RealTimeDataItem	 SMS_CHn_ERRV[15];/* 	{"SMS_CH1_ERRV",	    {"通道 1 电流故障值", " SMS_CH1_ERRV", ""}};*/	\
RealTimeDataItem	 SMS_CHn_KWH[15]; /*	{"SMS_CH1_KWH",	    {"通道 1 累积电能", " SMS_CH1_KWH", ""}};*/	\
/*gnss[10]*/\
RealTimeDataItem	GNSSn_S[10];/*	{"GNSS1_S",	    {"GNSS1 设备在线状态", "GNSS1_S", " 0 正常 1 掉线 "}};	*/\
RealTimeDataItem	GNSSn_N_T[10];/*	 	{"GNSS1_N_T",	    {"GNSS1 最近一次数据时间", "GNSS1_N_T", "（时间戳格式）"}};	*/\
RealTimeDataItem	GNSSn_ITEM[10];/*		{"GNSS1_ITEM",	    {"GNSS1 当日报文条目数量", "GNSS1_ITEM", ""}};*/	\
RealTimeDataItem	GNSSn_SIZE[10];/*		{"GNSS1_SIZE",	    {"GNSS1 当日报文字节大小", "GNSS1_SIZE", ""}};*/	\
/*DAM[6]*/\
RealTimeDataItem	 DAMn_S	[6]; /*{"DAM1_S",	    {"大坝安全设备 1 在线状态", " DAM1_S", " 0 正常 1 掉线"}};*/	\
RealTimeDataItem	 DAMn_N_T[6];/*	{"DAM1_N_T",	    {"大坝安全监测 1 最近一次数据时间", " DAM1_N_T", ""}};*/	\
/*Cam[10]*/\
RealTimeDataItem	NVR_S	{"NVR_S",	    {"硬盘录像机状态      ", "NVR_S", " 0正常 1 掉线 "}};	\
RealTimeDataItem	NVR_OFF_TM	{"NVR_OFF_TM",	    {"硬盘录像机离线时间", "NVR_OFF_TM", "时间戳格式"}};	\
RealTimeDataItem	CAMn_S[10];/*	{"CAM1_S",	    {"摄像机1状态          ", "CAM1_S", "0 正常 1 掉线 "}};	*/\
RealTimeDataItem	CAMn_OFF_TM[10];/*	{"CAM1_OFF_TM",	    {"摄像机1 离线时间", "CAM1_OFF_TM", "时间戳格式"}};*/	\
\
RealTimeDataItem	_4G_S	{"4G_S",	    {"4G 平安报状态", "4G_S", "0 正常 1 异常 "}};	\
RealTimeDataItem	LAN_S 	{"LAN_S",	    {"有线平安报状态", "LAN_S", "0 正常 1 异常 "}};	\
RealTimeDataItem	GPS_S 	{"GPS_S",	    {"北斗平安报状态", "GPS_S", "0 正常 1 异常 "}};	\
RealTimeDataItem	 RAIN_S	{"RAIN_S",	    {"传感器状态", " RAIN_S", "0 正常 1 异常(指短时间内产生异常雨量错误)"}};	\
RealTimeDataItem	WATER_S	{"WATER_S",	    {"传感器通信状态", "WATER_S", "0 正常 1 异常"}};	\
RealTimeDataItem	 HT_C_S 	{"HT_C_S",	    {"传感器通信状态", " HT_C_S", "0 正常 1 异常 "}};	\
RealTimeDataItem	 HT_H 	{"HT_H",	    {"湿度", " HT_H", ""}};	\
RealTimeDataItem	 HT_T	{"HT_T",	    {"温度", " HT_T", ""}};	\
RealTimeDataItem	 OD_S	{"OD_S",	    {"开箱状态", " OD_S", " 0 关箱 1 开箱"}};	\
RealTimeDataItem	 WATER_WARN	{"WATER_WARN",	    {"水位预警状态", " WATER_WARN", " 0 正常 1 异常"}};	\
RealTimeDataItem	 TC_S	{"TC_S",	    {"温度控制状态", " TC_S", " 0 未开启降温 1 已开启降温"}};	\
RealTimeDataItem	 HC_S	{"HC_S",	    {"湿度控制状态", " HC_S", " 0 未开启除湿 1 已开启除湿"}};	\
RealTimeDataItem	 IB_C_S	{"IB_C_S",	    {"通信状态", " IB_C_S", " 0 正常 1 掉线"}};	\
RealTimeDataItem	 IB_C_ERRN	{"IB_C_ERRN",	    {"通信错误计数", " IB_C_ERRN", ""}};	\
RealTimeDataItem	 IB_MA_P	{"IB_MA_P",	    {"手自动位置", " IB_MA_P", " 0 自动 1 手动"}};	\
RealTimeDataItem	 IB_SW_P	{"IB_SW_P",	    {"开关位置", " IB_SW_P", " 0 断开 1 连接"}};

//逆变-太阳能
#define __Inv_Solar_Data(AAAA) \
    AAAA(INV_C_S);\
    AAAA(INV_C_ERRN);\
    AAAA(INV_BP_S);\
    AAAA(INV_W_S);\
    AAAA(BAT_V);\
    AAAA(INV_O_V);\
    AAAA(INV_GRID_V);\
    AAAA(BAT_I);\
    AAAA(INV_I);\
    AAAA(GRID_I);\
    AAAA(LOAD_I);\
    AAAA(BAT_P);\
    AAAA(INV_P);\
    AAAA(GRID_P);\
    AAAA(LOAD_P);\
    AAAA(LOAD_PER);\
    AAAA(AC_T);\
    AAAA(TR_T);\
    AAAA(DC_T);\
    AAAA(INV_R);\
    AAAA(GRID_R);\
    AAAA(LOAD_R);\
    AAAA(N_LINE_R);\
    AAAA(DC_R);\
    AAAA(ETH_R);\
    AAAA(PV_C);\
    AAAA(PV_C_ERRN);\
    AAAA(PV_W_S);\
    AAAA(MPPT_S);\
    AAAA(PV_CHA_S);\
    AAAA(PV_V);\
   /* AAAA(BAT_V);*/\
    AAAA(PV_I);\
    AAAA(PV_P);\
    AAAA(BAT_R);\
    AAAA(PV_R);

//电表
#define __Meter_Data(AAAA) \
    AAAA(EP_C_S);\
    AAAA(EP_C_ERRN);\
    AAAA(EP_KWH);\
    AAAA(IN_GRID_V);\
    AAAA(IN_GRID_I);\
    AAAA(IN_GRID_P);

//断路器
#define __Duanluqi_Data(AAAA) \
    AAAA(PB_C_S);\
    AAAA(PB_C_ERRN);\
    AAAA(PB_MA_P);\
    AAAA(PB_SW_P);
//智能开关
#define __SmartSwitch_Data(AAAA) \
    AAAA(SMS_C_S);\
    AAAA(SMS_C_ERRN);\
    AAAA(SMS_PB_S);\
    AAAA(SMS_V);\
    AAAA(SMS_VERR);\
    AAAA(SMS_VERRV);
    // AAAA(SMS_CH1_S);\
    // AAAA(SMS_CH1_I);\
    // AAAA(SMS_CH1_ERR);\
    // AAAA(SMS_CH1_ERRV);\
    // AAAA(SMS_CH1_KWH);

//GNSS
#define __GNSS_Data(AAAA) \
    AAAA(GNSS1_S);\
    AAAA(GNSS1_N_T);\
    AAAA(GNSS1_ITEM);\
    AAAA(GNSS1_SIZE);\
//大坝安全
#define __Daba_Data(AAAA) \
    AAAA(DAM1_S);\
    AAAA(DAM1_N_T);\
    AAAA(DAM2_S);\
    AAAA(DAM2_N_T);\
    AAAA(DAM3_S);\
    AAAA(DAM3_N_T);\
    AAAA(DAM4_S);\
    AAAA(DAM4_N_T);\
    AAAA(DAM5_S);\
    AAAA(DAM5_N_T);\
    AAAA(DAM6_S);\
    AAAA(DAM6_N_T);
//摄像头
#define __Cam_Data(AAAA) \
    AAAA(NVR_S);\
    AAAA(NVR_OFF_TM);\
    AAAA(CAM1_S);\
    AAAA(CAM1_OFF_TM);
//平安报
#define __pingan_Data(AAAA) \
    AAAA(_4G_S); \
    AAAA(LAN_S);\
    AAAA(GPS_S);\
//雨量水位 
#define __Yu_Data(AAAA) \
    AAAA(RAIN_S);
//水位 水位预警
#define __Water_Data(AAAA) \
    AAAA(WATER_S); \
    AAAA(WATER_WARN);

//箱内温湿  
#define __HT_Data(AAAA) \
    AAAA(HT_C_S);\
    AAAA(HT_H);\
    AAAA(HT_T); 
//开箱
#define __OD_Data(AAAA) \
    AAAA(OD_S);

//温湿
#define __TC_HC_Data(AAAA)   \
    AAAA(TC_S);\
    AAAA(HC_S);
//进线断路器
#define __IB_Data(AAAA) \
    AAAA(IB_C_S);\
    AAAA(IB_C_ERRN);\
    AAAA(IB_MA_P);\
    AAAA(IB_SW_P);

#endif